<template>
  <div>
    <HeaderBar :currentName="_t18('download_center1', ['aams', 'robinhood2'])"></HeaderBar>
    <img src="https://s2023.oss-cn-qingdao.aliyuncs.com/echo2.0c003645b4e5b43e2a18180bd5a4335b9.png" style="width: 100%; height: auto;">
    <div style="padding: 0 0.4rem">

      <div v-for="item in list" style="margin-top: 5%;border-bottom: 1px solid #ddd;padding-bottom: 6%">
        <div style="display: flex;justify-content: space-between">
          <div style="font-weight: bold;font-size: 16px">
            成为比特方舟节点
          </div>
          <div style="font-weight: bold;font-size: 14px;text-transform: uppercase;">
            币种: {{item.sellCoin}} {{ item.sellSymbol }}
          </div>
        </div>
        <div class="btn" @click="getbuyNodeAdd(item.id)">
            <p>成为节点</p>
          </div>
      </div>
 

    </div>
  </div>
</template>
<script setup>
import { showToast } from 'vant'
import { _t18 } from "@/utils/public";
import { getwalletRecordlist } from "@/api/trade";
import { getnodelist, getbuyNode } from "@/api/user";
// 撤单
const list = ref([])
const route = useRoute();
const cancelOrder = async () => {
  const res = await getnodelist({})
  list.value = res.rows
}
const getbuyNodeAdd = async (id) => {
	console.log(id,' list.value ')
  const nodeMgrId = id
  const res = await getbuyNode({ nodeMgrId:id })
  if (res.code == '200') {
    showToast('购买成功')
  } else {
    showToast(res.msg)
  }
}
onMounted(() => {
  cancelOrder()
})

</script>
<style scoped lang="scss">
.btn {
  padding: 0 15px 55px;
  margin-top: 20px;
  p {
    text-align: center;
    padding: 14px 0;
    color: var(--ex-font-color);
    font-size: 16px;
    background-color: var(--ex-div-bgColor1);
    border-radius: 3px;
  }
}
</style>
